
from bs4 import BeautifulSoup

import requests
import string
import sys

f = open("instructorlist.txt", "w")

for letter in string.ascii_uppercase:
	print ".",
	sys.stdout.flush()
	first_letter = letter
	url = "catalog.oregonstate.edu/SOCSearcher.aspx?isa="+first_letter+"%&wks=&chr=abcdeop"

	r = requests.get("http://" + url)
	data = r.text
	soup = BeautifulSoup(data)

	for element in soup.find_all('option'):
		name = element.get_text('value').strip().lower()
		f.write(name + "\n")
f.close()